$(document).ready(function() {
	$("#div_main_frame").height($(document).height());
	manageIFrame(true);
	$(".logo").click($.fn.GOHOME);
	$(".display_searchby").click($.fn.GOTO_SEARCHBY);
	$(".display_product").click($.fn.GOTO_PRODUCTS);
	$("#login_btn").click($.fn.GOTO_LOGIN);
});

function manageIFrame(displayEvents){
	if(displayEvents){
		$("#frame_content").width($(".main_content").width() - 38);
		resizeMainIframeWithHeader();
	}else{
		resizeMainIframeFull();
	}
	
}
function resizeMainIframeFull(){
	$(".header_content").hide();
	$("#frame_content").height($(document).height() - 60);
}

function resizeMainIframeWithHeader(){
	$("#frame_content").height($(document).height() - 275);
	$(".header_content").show();
}

// Action zone
$.fn.GOHOME = function () {
//	resizeMainIframeWithHeader();
//	$("#frame_content").attr('src', 'HomeServlet');
	window.location = 'http://bjcmedical.com/';
//	window.location = document.location.origin;
};
$.fn.GOTO_SEARCHBY = function () {
	resizeMainIframeFull();
	$("#frame_content").attr('src', 'SearchByServlet');
};
$.fn.GOTO_PRODUCTS = function () {
	resizeMainIframeFull();
	$("#frame_content").attr('src', 'ProductServlet');
};
$.fn.GOTO_LOGIN = function () {
	$("#login_frm").submit();
};
// ## Action